package Teach;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * description:
 * author:zcx
 * lenovo
 * 时间：2022.01.18.10.29
 */
public class Pj3Copy {
    public static void main(String[] args) throws IOException {
        //实现文件复制
        FileInputStream fis = new FileInputStream("c:/u.jpg");
        //DataInputStream dis = new DataInputStream(fis);
        FileOutputStream fos = new FileOutputStream("d:/u2.jpg");
        //fos.write(fis.readAllBytes());
        byte[] buf = new byte[1024];
        int len = 0;
        while((len = fis.read(buf))!=-1) {
            fos.write(buf, 0, len);
        }
        fos.close();
    }
}
